import Vue from 'vue'
import VueRouter from 'vue-router'

import News from '../views/News/index.vue'
import Mine from '../views/Mine/index.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'News',
    component: News
  },
  {
    path: '/knowledge',
    name: 'Knowledge',
    /*按需加载*/
    component: () => import(/* webpackChunkName: "about" */ '../views/Knowledge/index.vue')
  },
  {
    path: '/mine',
    name: 'Mine',
    /*按需加载*/
    component: () => import(/* webpackChunkName: "about" */ '../views/Mine/index.vue')
  },
  {
    path: '/detail',
    name: 'Detail',
    component: () => import(/* webpackChunkName: "about" */ '../views/News/detail.vue')
  }
]

const router = new VueRouter({
  routes
})

export default router
